// eslint-disable-next-line
import { UserLayout, BasicLayout, RouteView, BlankLayout, PageView } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

export const asyncRouterMap = [

  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '首页' },
    redirect: '/dashboard/workplace',
    children: [
      // dashboard
      {
        path: '/dashboard',
        name: 'dashboard',
        redirect: '/dashboard/workplace',
        component: RouteView,
        meta: { title: '仪表盘', keepAlive: true, icon: bxAnaalyse, permission: [ 'dashboard' ] },
        children: [
          {
            path: '/dashboard/workplace',
            name: 'Workplace',
            component: () => import('@/views/dashboard/Workplace'),
            meta: { title: '工作台', keepAlive: true, permission: [ 'dashboard' ] }
          }
        ]
      },
      {
        path: '/auth',
        name: 'Auth',
        redirect: '/auth/roleList',
        component: PageView,
        meta: { title: '权限管理', keepAlive: true, icon: bxAnaalyse, permission: [ 'dashboard' ] },
        children: [
          {
            path: 'roleList',
            name: 'RoleList',
            component: () => import('@/views/role/RoleList'),
            meta: { title: '角色列表', keepAlive: true, permission: [ 'dashboard' ] }
          }, {
            path: 'roleDetail',
            name: 'RoleDetail',
            component: () => import('@/views/role/RoleDetail'),
            hidden: true,
            meta: { title: '角色详情', keepAlive: false, permission: [ 'dashboard' ] }
          },
          {
            path: 'adminMenuList',
            name: 'AdminMenuList',
            component: () => import('@/views/adminMenu/list'),
            meta: { title: '菜单列表', keepAlive: true, permission: [ 'dashboard' ] }
          }, {
            path: 'adminMenuDetail',
            name: 'AdminMenuDetail',
            component: () => import('@/views/adminMenu/detail'),
            hidden: true,
            meta: { title: '菜单详情', keepAlive: false, permission: [ 'dashboard' ] }
          },
          {
            path: 'adminUserList',
            name: 'AdminUserList',
            component: () => import('@/views/adminUser/AdminUserList'),
            meta: { title: '用户列表', keepAlive: true, permission: [ 'dashboard' ] }
          }, {
            path: 'adminUserDetail',
            name: 'AdminUserDetail',
            component: () => import('@/views/adminUser/AdminUserDetail'),
            hidden: true,
            meta: { title: '用户详情', keepAlive: false, permission: [ 'dashboard' ] }
          },
          {
            path: '/adminDeptList',
            component: () => import('@/views/adminDept/list'),
            name: 'AdminDeptList',
            meta: { title: '部门列表', keepAlive: true, noCache: true }
          }, {
            path: 'adminDeptDetail',
            name: 'AdminDeptDetail',
            component: () => import('@/views/adminDept/detail'),
            hidden: true,
            meta: { title: '部门详情', keepAlive: false, icon: 'detail' },
          }
        ]
      }
    ]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'recover',
        name: 'recover',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Recover')
      },
      // {
      //   path: 'register-result',
      //   name: 'registerResult',
      //   component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      // }
    ]
  },
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }

]
